function isHello(responseXML) {
	var resp;
	var greetings = responseXML.getElementsByTagName("greetings")[0];
	var greeting = greetings.getElementsByTagName("greeting");
	resp = greeting[0].firstChild.nodeValue;
	if (resp == "hello") {
		alert("!");
	} else {
		alert("?");
	}
}

function login() {
	var req = newXMLHttpRequest();
	var arguments = "name=sau";

	req.open("POST", "JSconnect.do", true);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	req.setRequestHeader("Content-Length", arguments.length);
	req.onreadystatechange = getReadyStateHandler(req, isHello);

	req.send(arguments);
}